package day0607;

public class Test5 {
    public static void main(String[] args) {
        //1.用外循环控制男性的数量(最多有9个)(举例：当男人味０个女的为０个时小孩36能否搬完)
        //(再举例：当男人味０个女的为1个时小孩35能否搬完)
        for(double man=0;man<=9 ;man++){
            //2.用外循环控制女性的数量(一个女性搬3块，所以最多有9个)
            for(double woman=0;woman<=12  ;woman++){
                //3.小孩的数量是36-男-女
                double boy=36-man-woman;
                //4.三种人如果能一次性搬完36块就打印三种人的个数
                if(36 ==  man*4 + woman*3 + boy/2 ){
                    System.out.println(man+",\t"+woman+",\t"+boy);
                }
            }
        }



        double man=0;
        while(man<=9){
            double woman=0;
            while(woman<=12){
                //3.小孩的数量是36-男-女
                double boy=36-man-woman;
                //4.三种人如果能一次性搬完36块就打印三种人的个数
                if(36 ==  man*4 + woman*3 + boy/2 ){
                    System.out.println(man+",\t"+woman+",\t"+boy);
                }
                woman++;
            }
            man++;
        }



    }
}